using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using MongoDB.Bson;
using UnityEditor;
using UnityEngine;

namespace Framework.Editor.ServerConfig
{
	public class ServerConfigEditor: EditorWindow
	{
		private const string s_ConfigDir = @"../Config/StartConfig/";

		private List<string> m_Files;

		private int m_SelectedIndex;

		private string m_FileName = "LocalAllServer.txt";

		private AppType m_AppType = AppType.None;

		private readonly List<StartConfig> m_StartConfigs = new List<StartConfig>();

		public static void ShowWindow()
		{
			string arguments = $"App.dll --appId={1} --appType={AppType.AllServer} --config=../Config/StartConfig/LocalAllServer.txt";
			ProcessUtilty.Run("dotnet", arguments, "../Bin/");
			// GetWindow(typeof(ServerConfigEditor));
		}

        private void OnGUI()
        {
            if (GUILayout.Button("启动"))
			{
				string arguments = $"App.dll --appId={1} --appType={AppType.AllServer} --config=../Config/StartConfig/{this.m_FileName}";
				ProcessUtilty.Run("dotnet", arguments, "../Bin/");
			}
        }
	}
}